<?php

namespace plugin\admin\app\model;

use plugin\admin\app\model\Base;
use const support\refund_rule_remarks;

/**
 * @property integer $id ID(主键)
 * @property integer $order_id 订单ID
 * @property integer $member_id 用于ID
 * @property string $order_refund_sn 退款订单号
 * @property string $order_receipt_amount 订单支付金额
 * @property string $order_refund_amount 订单退款金额
 * @property integer $order_deduction_type 订单扣减类型
 * @property string $order_deduction_amount 订单扣减金额
 * @property integer $order_refund_status 订单退款状态，0待处理，1处理完成，2处理失败
 * @property integer $create_time 创建时间
 * @property integer $update_time 更新时间
 * @property string $fail_reason 退款失败理由
 * @property string $order_refund_desc 退单理由
 */
class RlOrderRefund extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'rl_order_refunds';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';
    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    public function getOrderDeductionTypeTitleAttribute($val): string
    {
        return refund_rule_remarks[$this->order_deduction_type]??'';
    }

     public $appends=['order_deduction_type_title'];

}
